package com.yikes.yygh.pojo.enums;

import com.yikes.yygh.common.enums.ResultCodeInterface;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @Author: guanrong.yin
 * @Date: 2025/5/1 20:29
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum HospServiceEnums implements ResultCodeInterface, Serializable {

    ID_LIST_NOT_NULL("-205", "传参数组idList不能为空"),
    SYSTEM_EXECUTION_ERROR("500", "系统执行出错"),
    ;

    private String code;

    private String msg;

    @Override
    public String toString() {
        return "{" +
                "\"code\":\"" + code + '\"' +
                ", \"msg\":\"" + msg + '\"' +
                '}';
    }


    public static HospServiceEnums getValue(String code) {
        for (HospServiceEnums value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        // 默认系统执行错误
        return SYSTEM_EXECUTION_ERROR;
    }

}
